
import Vue from 'vue'
import App from '@/App'
import router from '@/router'                 // api: https://github.com/vuejs/vue-router
import store from '@/store'                   // api: https://github.com/vuejs/vuex
import VueCookie from 'vue-cookie'            // api: https://github.com/alfhen/vue-cookie                       // api: https://github.com/ElemeFE/element
import '@/icons'                              // api: http://www.iconfont.cn/
import 'static/css/common-default.css'
import '@/assets/scss/page-layout.scss'
// import '@/assets/scss/varable-default.scss'
import 'static/css/icon/iconfont.css'
import 'bontal-base-ui/dist/bontal-base-ui.css';
import BtUi from 'bontal-base-ui';
Vue.use(BtUi);
window.Message = BtUi.Message;
window.MessageBox = BtUi.MessageBox;

// import 'element-ui/lib/theme-chalk/index.css';
// import ElementUI from 'element-ui'
import httpRequest from '@/utils/httpRequest' // api: https://github.com/axios/axios
import { isAuth } from '@/utils'
import cloneDeep from 'lodash/cloneDeep'
import echarts from 'echarts'

import VueCodeMirror from 'vue-codemirror'
import 'codemirror/lib/codemirror.css'
// 全局组件引入
import ruleConfig from './components/rule-config'
import formula from './views/modules/drools/ruleConfig/zerenrules/formula'
import MyColumn from './components/my-column'
import MyTable from './components/my-table'
import RulesInput from './components/rules-input'
import {message} from './utils/resetMessage'

// Vue.use(ElementUI);
Vue.use(VueCodeMirror)
Vue.prototype.$echarts = echarts
Vue.prototype.$message = message

Vue.use(VueCookie)
Vue.config.productionTip = false

// 非生产环境, 适配mockjs模拟数据                 // api: https://github.com/nuysoft/Mock
if (process.env.NODE_ENV !== 'production') {
  require('@/mock')
}
// 全局组件
Vue.component('ruleConfig', ruleConfig)
Vue.component('formula', formula)
Vue.component('MyColumn', MyColumn)
Vue.component('MyTable', MyTable)
Vue.component('RulesInput', RulesInput)
// 挂载全局
Vue.prototype.$http = httpRequest // ajax请求方法
Vue.prototype.isAuth = isAuth     // 权限方法

// 保存整站vuex本地储存初始状态
window.SITE_CONFIG['storeState'] = cloneDeep(store.state)

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  template: '<App/>',
  components: { App }
})
